package ngat.oss.simulation;

import java.util.*;

public class Accounts {

    private HashMap accounts;

    public Accounts() {
	accounts = new HashMap();
    }

    public Account getAccount(int id) {
	return (Account)accounts.get(new Integer(id));
    }

    public void addAccount(int id, Account account) {
	accounts.put(new Integer(id), account);
    }

    public void removeAccount(int id) {
	accounts.remove(new Integer(id));
    }

    public void clear() {
	accounts.clear();
    }

    public Iterator listAccounts() {
	return accounts.values().iterator();
    }

    public Iterator listAccountIds() {
	return accounts.keySet().iterator();
    }

}
